Subtyping With Antimirov’s Algorithm

نویسنده

  • Stefan Hohenadel
چکیده

I start with an explanation of the notion of ‘subtyping’ to make clear what it means to subtype a type r against a type s. It will be pointed out, how types are represented in the subtyping algorithm. Then I will explain the main idea of the subtyping algorithm and make clear what subconcepts are needed. In detail, those are the concepts of checking for -inclusion, leading names and partial derivatives of regular expressions and regular inequalities. These are treated in four separate sections. In the course of these sections, I will introduce small running examples. In section 8, I will construct a big example for a complete recursive application of the algorithm. The description will be closed by a short conclusion. 1 What Does ‘Subtyping’ Mean? A typed language like XQuery defines built-in types and allows the definition of user defined types. The compilation of a piece of program code written in a typed language therefore requires some kind of check, whether the use of the declared instances and variables in this code obeys the type rules. The two tasks connected with this requirement are type inference and type checking. Type inference means deriving the type of a simple or composite expression e, which requires the application of type rules on e. Type checking means to check whether the use of the declared instances is coherent with the type rules in any explicit or implicit assignment. In the following, I will concentrate on a single but central task concerning type checking, the so called subtyping. Subtyping means to check for two types r and s whether the set of instances matched by r is a subset of the set of instances matched by s. A subtyping facility is an important feature because the translation process from XQuery to the XQuery core language makes excessive use of typeswitch commands. Without any subtyping mechanism, we would not be able to implement efficient typechecking. Furthermore, in any language, where explicit typechecking is implemented (e.g. represented by the typeswitch command), an implementation of subtyping must be available, too. 2 Type and Type Instance Representation Since types are represented by regular expressions, the quite hand-waving definition above becomes more clear: The types r and s are represented by regular expressions, so both r and s define languages as sets of sentences. We denote the language defined by a regular expression p as L(p), where L(p) is a set of sentences. In the context of subtyping, these statements are instances of types. For XQuery this means the sentences defined by L(p) are XML tree structures. We can now formulate our first

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Symbolic Solving of Extended Regular Expression Inequalities Technical Report

This paper presents a new solution to the containment problem for extended regular expressions that extends basic regular expressions with intersection and complement operators and consider regular expressions on infinite alphabets based on potentially infinite character sets. Standard approaches deciding the containment do not take extended operators or character sets into account. The algorit...

متن کامل

From $\mu$-Regular Expressions to Pushdown Automata

We extend Antimirov’s partial derivatives from regular expressions to μ-regular expressions that describe context-free languages. We prove the correctness of partial derivatives as well as the finiteness of the set of iterated partial derivatives. The latter are used as pushdown symbols in our construction of a nondeterministic pushdown automaton, which generalizes Antimirov’s NFA construction.

متن کامل

Symbolic Solving of Extended Regular Expression Inequalities

This paper presents a new algorithm for the containment problem for extended regular expressions that contain intersection and complement operators and that range over infinite alphabets. The algorithm solves extended regular expressions inequalities symbolically by term rewriting and thus avoids the translation to an expression-equivalent automaton. Our algorithm is based on Brzozowski’s regul...

متن کامل

Subtyping Recursive Types Modulo Associative Commutative Products

We study subtyping of recursive types in the presence of associative and commutative products—that is, subtyping modulo a restricted form of type isomorphisms. We show that this relation, which we claim is useful in practice, is a composition of the usual subtyping relation with the recently proposed notion of equality up to associativity and commutativity of products, and we propose an efficie...

متن کامل

A On Subtyping-Relation Completeness, with an Application to Iso-Recursive Types

Well-known techniques exist for proving the soundness of subtyping relations with respect to type safety. However, completeness has not been treated with widely applicable techniques, as far as we’re aware. This paper develops techniques for stating and proving that a subtyping relation is complete with respect to type safety and applies the techniques to the study of iso-recursive subtyping. A...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2003